memory network.def (974B)
1 % Draw a condensed memory network 2 % Arguments: 3 % [#1] opacity (default: 1) 4 % {#2} position 5 % {#3} node name suffix 6 % [#4] exponent (default: none) 7 \NewDocumentCommand{\memorynetwork}{O{1} m m o}{ 8 \begin{scope}[shift={#2},opacity=#1] 9 \draw[dashdotted,color=Dark2-B,thick,fill=white] (-0.125, 0.875) rectangle (1.5, -0.625); 10 \node (q#3) at (1.25, -0.375) {\tiny \(\vctr{q}\IfNoValueF{#4}{^{(#4)}}\)}; 11 \node (o#3) at (1.25, 0.625) {\tiny \(\vctr{o}\IfNoValueF{#4}{^{(#4)}}\)}; 12 \node (m#3) at (0.06, 0.125) {}; 13 \draw (0, 0.1) rectangle (0.75, 0); 14 \draw (0, 0.25) rectangle (0.75, 0.15); 15 \draw[arrow] (q#3) .. controls ++(180:0.25) and ++(270:0.425) .. (0.375, 0); 16 \draw[arrow] (0.375,0.25) .. controls ++(90:0.425) and ++(180:0.35) .. (o#3); 17 \draw[arrow,rounded corners=2pt] (1.25,-0.8) -- (1.6,-0.8) -- (1.6,0.975) -- (1.25,0.975); 18 \end{scope} 19 } 20 21 \tikzset{ 22 memorybrace/.style={decorate,thick,color=Dark2-C,decoration={brace,amplitude=5}} 23 }